package com.kaikeba.bean;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Objects;

/**
 * 快递员bean类
 */
public class Courier implements Serializable {

    private int id;
    private String userName;
    private String userPhone;
    private String identityNumber;
    private String password;
    private Timestamp registerTime;
    private Timestamp loginTime;
    private int passNumber;

    @Override
    public String toString() {
        return "Courier{" +
                "id=" + id +
                ", userName='" + userName + '\'' +
                ", userPhone='" + userPhone + '\'' +
                ", identityNumber='" + identityNumber + '\'' +
                ", password='" + password + '\'' +
                ", registerTime=" + registerTime +
                ", loginTime=" + loginTime +
                ", passNumber=" + passNumber +
                '}';
    }

    public Courier(int id, String userName, String userPhone, String identityNumber, String password) {
        this.id = id;
        this.userName = userName;
        this.userPhone = userPhone;
        this.identityNumber = identityNumber;
        this.password = password;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Courier courier = (Courier) o;
        return id == courier.id &&
                passNumber == courier.passNumber &&
                Objects.equals(userName, courier.userName) &&
                Objects.equals(userPhone, courier.userPhone) &&
                Objects.equals(identityNumber, courier.identityNumber) &&
                Objects.equals(password, courier.password) &&
                Objects.equals(registerTime, courier.registerTime) &&
                Objects.equals(loginTime, courier.loginTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, userName, userPhone, identityNumber, password, registerTime, loginTime, passNumber);
    }

    public Courier(String userName, String userPhone, String identityNumber, String password) {
        this.userName = userName;
        this.userPhone = userPhone;
        this.identityNumber = identityNumber;
        this.password = password;
    }

    public Courier(int id, String userName, String userPhone, String identityNumber, String password, Timestamp registerTime, Timestamp loginTime, int passNumber) {
        this.id = id;
        this.userName = userName;
        this.userPhone = userPhone;
        this.identityNumber = identityNumber;
        this.password = password;
        this.registerTime = registerTime;
        this.loginTime = loginTime;
        this.passNumber = passNumber;
    }

    public Courier() {
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserPhone() {
        return userPhone;
    }

    public void setUserPhone(String userPhone) {
        this.userPhone = userPhone;
    }

    public String getIdentityNumber() {
        return identityNumber;
    }

    public void setIdentityNumber(String identityNumber) {
        this.identityNumber = identityNumber;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Timestamp getRegisterTime() {
        return registerTime;
    }

    public void setRegisterTime(Timestamp registerTime) {
        this.registerTime = registerTime;
    }

    public Timestamp getLoginTime() {
        return loginTime;
    }

    public void setLoginTime(Timestamp loginTime) {
        this.loginTime = loginTime;
    }

    public int getPassNumber() {
        return passNumber;
    }

    public void setPassNumber(int passNumber) {
        this.passNumber = passNumber;
    }
}
